/*
 * @Author: Starfish_DL
 * @Date: 2020-10-07 20:49:00
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-10-07 21:11:06
 * @CurrentVersion: 1.0
 * @Description: 
 */

public class TestInstance {
    public static void method1(Person e) {
        e=new Student();
        System.out.println(e.getInfo());
        if(e instanceof Person) {
            System.out.println("a person");
        }
        else if(e instanceof Student){
            System.out.println("a student");
            System.out.println("a person");
        }
        else if (e instanceof Graduate) {
            System.out.println("a graduated student");            
            System.out.println("a student");
            System.out.println("a person");
        }
    }
    public static void main(String[] args) {
        Person per1=new Person();
        //Person per1=new Person();
        //Person per1=new Graduate();
        method1(per1);
    }
}
